/*
 * @Author: daidai
 * @Date: 2021-12-23 11:18:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-04-28 15:10:45
 * @FilePath: \web-pc\src\api\modules\index.js
 */
import qs from "qs";
import * as API from "../api";

export const paramType = {
  login: "/login",
  bigStatic: "/vp/biVisual/getDataByReadExcel", // 静态数据
  bigLLeft1: "/vp/biVisual/queryGoodsCounts", //货量统计
  bigLLeft2: "/vp/biVisual/getDataByReadExcel", //设备总览
  bigLLeft3: "/vp/biVisual/queryVehicleCounts", //车辆统计
  bigLCenter2: "/vp/biVisual/queryLineGoodsRank", // 线路货量排名
  bigLRight11: "/vp/biVisual/queryFecenQuantity", //实时预警
  bigLRight12: "/vp/biVisual/queryFecenRank", //园区发货量排名
  bigLRight21: "/vp/biVisual/queryCountsByGoodsType", //货物分类统计
  bigLRight22: "/vp/biVisual/queryFreightCountsByGoodsType", //货物运费排名
  bigRRight1: "/vp/biVisual/queryNetGoods", // 网络货运统计
  bigRCenter21: "/vp/biVisual/queryDjwmsCounts", // 集仓宝数据统计
  bigRCenter22: "/vp/biVisual/queryLoginCountsByDjwms", // 集仓宝近7日登录次数
  bigCTOP: "/vp/biVisual/queryRealTimeCounts", // 中间实时数据
  bigCBottom1: "/vp/biVisual/queryFenceRankByRealTimes", // 实时园区排名【列表】
  bigCBottom2: "/vp/biVisual/queryLineRankByRealTimes", // 实时线路排名【列表】
  // mapWordMakers: "/vp/biVisual/queryLineData", // 当日线路信息【地图】
  mapCountyMakers: "/vp/biVisual/queryLineData", // 当日线路信息【地图】
  mapCounty1: "/vp/biVisual/queryGoodsRankByCompany", // 企业发货量排名
  mapCounty21: "/vp/biVisual/queryVehiclesByCompany", // 企业发货车辆信息
  mapCounty22: "/vp/biVisual/queryGoodsByVehicles", // 企业发货车辆的货物信息
  mapCityMakers: "/vp/biVisual/queryFenceData", // 园区信息【地图】
  mapCity2: "/vp/biVisual/queryFreightGoodsTypeByFence", // 园区货物分类统计
  mapCity3: "/vp/biVisual/queryDataByFence", // 园区近7日发货统计

  mapGps: "/vp/biVisual/queryCarGps", // 查询车辆轨迹
  mapCityMakers: "/vp/biVisual/queryFenceData", // 园区信息【地图】
};
/******************      通用增删改查       ********************* */
/**
 * 通用列表
 * @param {*} param
 */
export const currentList = (key, param) => {
  return API.GET(paramType[key] + "/list", param);
};
export const currentPage = (key, param) => {
  return API.GET(paramType[key] + "/page", param);
};
/**
 * 查询可选择的列表
 * @param {*} param
 */
export const currentSelectList = (key, param) => {
  return API.GET(paramType[key] + "/selectList", param);
};

/**
 * 通用新增
 * @param {*} param
 */
export const currentSave = (key, param) => {
  return API.POST(paramType[key] + "/save", param);
};
/**
 * 通用修改
 * @param {*} param
 */
export const currentUpdate = (key, param) => {
  return API.POST(paramType[key] + "/update", param);
};

/**
 * 通用删除
 * @param {*} param
 */
export const currentDelete = (key, param) => {
  return API.POST(paramType[key] + "/delete", param);
};

/**
 * 通用获取所有不分页
 * @param {*} param
 */
export const currentSelect = (key, param) => {
  return API.GET(paramType[key] + "/select", param);
};

/**
 * 通用GET
 * @param {*} param
 */
export const currentGET = (key, param) => {
  return API.GET(paramType[key], param);
};
/**
 * 通用POST
 * @param {*} param
 */
export const currentPOST = (key, param) => {
  return API.POST(paramType[key], param);
};

export const currentPOST2 = (key, param) => {
  return API.POST2(paramType[key], param);
};
// 通用接口集合
export const currentApi = {
  currentList,
  currentPage,
  currentSave,
  currentUpdate,
  currentDelete,
  currentSelect,
  currentSelectList,
  currentPOST,
  currentPOST2,
  currentGET,
};
